{set:
	$start = IFilter::act(IReq::get('start'));
	$end   = IFilter::act(IReq::get('end'));
	$countData = statistics::spandAmount($start,$end);
}

{js:my97date}
{js:chart}
<script type='text/javascript' src='{theme:javascript/event.js}' charset="UTF-8"></script>

<div class="headbar">
	<div class="position"><span>统计</span><span>></span><span>基础数据统计</span><span>></span><span>销售额统计</span></div>
	<form action='{url:/market/amount}' method='get'>
		<input type='hidden' name='controller' value='market' />
		<input type='hidden' name='action' value='amount' />
		<div class="operating">
			<div class="search f_l">
				<input type="text" name='start' class="Wdate" id="date_start" value='{$start}' pattern='date' alt='' onFocus="WdatePicker()" onblur="FireEvent(this,'onchange')" /> —— <input type="text" name='end' pattern='date' value='{$end}' class="Wdate" id="date_end" onFocus="WdatePicker()" onblur="FireEvent(this,'onchange')" />
				<button class="btn"><span>查 询</span></button>
				<button class="btn" onclick="amountReport()"><span>导出报表</span></button>
			</div>
		</div>
    </form>
</div>

<div class="content_box">
	<h3>销售金额统计：</h3>
	<div class='cont'>
		<ul>
			<li>销售金额统计，更清楚了了解每月销售的情况，为你下一步的营销计划做出更好的判定！</li>
		</ul>
	</div>
</div>

<div class='content_box'>
	<div id="myChart" style="min-height:350px;"></div>
</div>

<script type='text/javascript'>
//图表生成
$(function()
{
	//图标模板
	userHighChart = $('#myChart').highcharts(
	{
		title:
		{
			text:'销售额'
		},
		xAxis:
		{
			title:
			{
				text:'时间'
			},
			categories:{echo:JSON::encode(array_keys($countData))},
		},
		yAxis:
		{
			title:
			{
				text:'金额(人)'
			},
		},
		series:
		[
			{
				name:'销售金额',
				data:{echo:JSON::encode(array_values($countData))}
			}
		],
		tooltip:
		{
			valueSuffix:'元'
		}
	});
});

function amountReport()
{
	var url   = '{url:/market/amount_report/start/@start@/end/@end@}';
	var start = $('#date_start').val();
	var end   = $('#date_end').val();
	url = url.replace("@start@",start).replace("@end@",end);
	window.open(url);
	return false;
}
</script>